<html style="height:100%;">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<head>
<title><%= app_localized_message(:label, :system_name) %>&nbsp;-&nbsp;<%= app_localized_message(:label, params[:controller]+"_"+params[:action]) %></title>
<%- csscomp('ext-2.1/ext-all, ext-2.1/columnLock, app/application') -%>
<%= @content_for_for_stylesheet %>
<%= csscomp_write() %>
</head>
<body style="height:100%;">
<div id='app_loading' style="visibility:hidden"><div class='app_loading_indicator'>Loading...</div></div>

<%= calendar_tag %>


<table border="0" class="container" cellspacing="0" style="margin:0px;">
    <tr>
        <td class="mainpage_head">
            <table border="0" cellpadding="0" cellspacing="0" style="width:100%;">
                <tr style="height:28px;">
                    <td valign="top">
                        <div style="float:left;"><%= link_to( image_tag("/images/logo.gif", {:alt=>app_localized_message(:label, :system_name)}), :controller=>:project, :action=>:index ) %></div>
                        <div style="float:right;" class="header_right_menu">
                        <span style="font-weight:bold;"><%=h session['user']['login_id'] %></span>
                        | <%= link_to(app_localized_message(:label, :myprofile),{:controller=>:user,:action=>:edit, :id=>session['user']['id']}) %>
                        | <%= link_to(app_localized_message(:label, :logout),{:controller=>:login,:action=>:logout}) %>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div id="mainpage_project_tabs_area" style="height:25px;"></div>
                        <div style="display:none;">
<%- if ! @g_projects.nil? -%>
                            <div id="mainpage_project_tabs" class="tabs">
                                <div class="mainpage_project_tabitem" id="mainpage_project_tabitem_edit_active" targetUrl="<%= url_for(:controller=>:project, :action=>:edit_active) %>" isactive="<%= params[:controller]=='project' && params[:action]=='edit_active' ? 'true' : 'false' %>" project_id="edit_active">
                                    <div style="width:40px;text-align:center;padding-top:2px;display:inline;"><%= image_tag('icon_tab_sel.gif', {:alt=>app_localized_message(:label, "project_edit_active")}) %></div>
                                </div>
<%- @g_projects.each do |p| -%>
                                <div class="mainpage_project_tabitem" id="mainpage_project_tabitem_<%= p.id %>" targetUrl="<%= url_for(:controller=>:project, :id=>p.id) %>" isactive="<%= @g_cur_project.nil? || p.id != @g_cur_project.id ? 'false' : 'true' %>" project_id="<%= p.id %>"><%=h p.project_name %></div>
<%- end -%>
                                <div class="mainpage_project_tabitem" id="mainpage_project_tabitem_new" targetUrl="<%= url_for(:controller=>:project, :action=>:new) %>" isactive="<%= params[:controller]=='project' && params[:action]=='new' ? 'true' : 'false' %>" project_id="new">
                                    <div style="width:40px;text-align:center;padding-top:2px;display:inline;"><%= image_tag('icon_tab_etc.gif', {:alt=>app_localized_message(:label, "project_new")}) %></div>
                                </div>
                            </div>
<%- end -%>
                        </div>
                        <table class="header_detail" cellspacing="0">
                            <tr>
                                <td>
<%- if @g_cur_project -%>
                                    <span style="float:left;">
                                        [&nbsp;<%= disp_project_name(@g_cur_project) %>&nbsp;]<%= app_localized_message(:label, :project) %>
                                        <%= '(' + disp_end_user_name(@g_cur_project) + ')' unless @g_cur_project.end_user_name.nil? %>&nbsp;&nbsp;
                                        <%=h disp_date_range(@g_cur_project) %>&nbsp;&nbsp;
                                        <%=h disp_projectusers(@g_cur_project) %>
                                    </span>
                                    <span style="float:right;font-style:normal;font-size:12px;">
                                        <%= link_to( app_localized_message(:label, :edit), :controller=>:project, :action=>:edit, :id=>@g_cur_project.id ) %>
                                    </span>
<%- end -%>
                                </td>
                            </tr>
                        </table>
                        
                        <table class="header_left_menu" cellspacing="0">
                            <tr>
                                <td>
<%- if @g_cur_project -%>
                                    <%= icon_label_link_tag('icon_left_menu_prefix.gif', app_localized_message(:label, :submenu_dashboard), {:controller=>:project,:action=>:index} ) %>&nbsp;&nbsp;&nbsp;
                                    <%= icon_label_link_tag('icon_left_menu_prefix.gif', app_localized_message(:label, :submenu_wbs), {:controller=>:project,:action=>:wbs} ) %>&nbsp;&nbsp;&nbsp;
                                    <%= icon_label_link_tag('icon_left_menu_prefix.gif', app_localized_message(:label, :submenu_gantt), {:controller=>:project,:action=>:gantt} ) %>&nbsp;&nbsp;&nbsp;
                                    <%= icon_label_link_tag('icon_left_menu_prefix.gif', app_localized_message(:label, :submenu_calendar), {:controller=>:project,:action=>:calendar} ) %>&nbsp;&nbsp;&nbsp;
                                    <%= icon_label_link_tag('icon_left_menu_prefix.gif', app_localized_message(:label, :files), {:controller=>:project,:action=>:file} ) %>&nbsp;&nbsp;&nbsp;
<%- end -%>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr><!--// endof header //-->
    <tr>
        <td class="mainpage_content">
            <table border="0" cellpadding="0" cellspacing="0" style="width:100%;height:100%;">
                <tr>
                    <td class="mainpage_pagecontent" valign="top"><%= yield %></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="mainpage_foot"></td>
    </tr>
</table>


<%= javascript_include_tag 'http://download.skype.com/share/skypebuttons/js/skypeCheck' %>
<script language="javascript" src="<%= url_for(:controller=>"localize", :action=>"load_message") %>"></script>
<script language="javascript" src="<%= url_for(:controller=>"localize", :action=>"load_functions") %>"></script>
<%- jscomp('ext-2.1/ext-base, ext-2.1/ext-all-debug, ext-2.1/ext-lang-ja, app/ext/columnLock, app/ext/ext-i3-extension, app/common/app, application, app/layout/mainpage, app/common/dlg_modal, app/common/dlg_datepick') -%>
<%= @content_for_for_javascript %>
<%= jscomp_write() %>
<script language="javascript">
<%= @content_for_for_ext_scripts %>
</script>
</body>
</html>
